package com.itheima.A08Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Random;

public class Test1 {
    public static void main(String[] args) {

        //班级里有N个学生，学生属性：姓名，年龄，性别。
        //实现随机点名器

        //创建集合
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"张三","李四","王五");

        //随机点名
        Random r = new Random();
        int i = r.nextInt(list.size());

        //打印姓名
        System.out.println(list.get(i));

    }
}
